home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 2000 November: Tool Chest / Dev.CD Nov 00 TC Disk 2.toast / pc / sample code / quicktime / codecs / qdmediahandler / qdrawhandler.h < prev    next >
Encoding:
Text File  |  2000-09-28  |  2.6 KB  |  113 lines

  1. //////////
  2. //
  3. //    File:        QDrawHandler.h
  4. //
  5. //    Contains:    Code for creating a derived media handler component for QuickDraw pictures.
  6. //
  7. //    Written by:    Tim Monroe
  8. //                Based on MyMediaComponent by John Wang (see develop issue 14).
  9. //
  10. //    Copyright:    © 1993 - 1999 by Apple Computer, Inc., all rights reserved.
  11. //
  12. //    Change History (most recent first):
  13. //
  14. //       <2>         01/05/99    rtm        revised coding style
  15. //       <1>         02/25/93    jw        first file; based on MyComponent shell
  16. //
  17. //////////
  18.  
  19. #pragma once
  20.  
  21.  
  22. //////////
  23. //
  24. // header files
  25. //
  26. //////////
  27.  
  28. #ifndef __MOVIES__
  29. #include <Movies.h>
  30. #endif
  31.  
  32. #ifndef __COMPONENTS__
  33. #include <Components.h>
  34. #endif
  35.  
  36. #ifndef __QUICKTIMECOMPONENTS__
  37. #include <QuickTimeComponents.h>
  38. #endif
  39.  
  40. #ifndef __MEDIAHANDLERS__
  41. #include <MediaHandlers.h>
  42. #endif
  43.  
  44. #ifndef __QDMEDIACOMMON__
  45. #include "QDMediaCommon.h"
  46. #endif
  47.  
  48.  
  49. //////////
  50. //
  51. // constants
  52. //
  53. //////////
  54.  
  55. // flags to keep track of changes to the current media environment
  56. #define    kQDMHAllChanged                    0xffffffff
  57. #define    kQDMHNothingChanged                0x00000000
  58. #define    kQDMHSetActive                    0x00000001
  59. #define    kQDMHSetRate                    0x00000002
  60. #define    kQDMHTrackEdited                0x00000004
  61. #define    kQDMHSetGWorld                    0x00000008
  62. #define    kQDMHSetDimensions                0x00000010
  63. #define    kQDMHSetMatrix                    0x00000020
  64. #define    kQDMHSampleDescChanged            0x00000040
  65.  
  66.  
  67. //////////
  68. //
  69. // data types
  70. //
  71. //////////
  72.  
  73. #if PRAGMA_STRUCT_ALIGN
  74.     #pragma options align=mac68k
  75. #elif PRAGMA_STRUCT_PACKPUSH
  76.     #pragma pack(push, 2)
  77. #elif PRAGMA_STRUCT_PACK
  78.     #pragma pack(2)
  79. #endif
  80.  
  81. typedef struct QDMH_Globals {
  82.     // component stuff
  83.     ComponentInstance                fDelegate;                // the base component we are delegating to
  84.     ComponentInstance                fSelf;                    // ourself
  85.     ComponentInstance                fParent;                // our parent, if we are targeted by another media handler
  86.     
  87.     // general characteristics
  88.     Movie                            fMovie;                    // the movie
  89.     Track                            fTrack;                    // the media's track
  90.     Media                            fMedia;                    // the media
  91.     Fixed                            fCurMediaRate;            // the media's current playback rate
  92.     Fixed                            fNewMediaRate;            // the media's new playback rate
  93.     Rect                            fGraphicsBox;            // the box we want to draw into
  94.     MatrixRecord                    fTrackMatrix;            // the track matrix
  95.     CGrafPtr                        fPort;
  96.     GDHandle                        fDevice;
  97.     long                            fSampleDescIndex;        // the index of the current sample description
  98.     long                            fWhatChanged;            // flags indicating changes in media environment
  99.     Boolean                            fEnabled;                // is the track enabled?
  100.     TimeValue                        fPrevMediaTime;            // previously drawn media time
  101. } QDMH_Globals, *QDMH_GlobalsPtr, **QDMH_GlobalsHdl;
  102.  
  103. #if PRAGMA_STRUCT_ALIGN
  104.     #pragma options align=reset
  105. #elif PRAGMA_STRUCT_PACKPUSH
  106.     #pragma pack(pop)
  107. #elif PRAGMA_STRUCT_PACK
  108.     #pragma pack()
  109. #endif
  110.  
  111.  
  112.  
  113.